import httpRequest from './request';

// 登录
export const login = (data: any) => {
  return httpRequest.post('/user/login', data);
}

// 全部岗位
export const queryAllPosts = () => {
  return httpRequest.get('/post/allData');
}

// 岗位列表
export const queryPosts = (params: any) => {
  return httpRequest.get('/post/lists', params);
}

// 岗位创建
export const postCreate = (data: any) => {
  return httpRequest.post('/post/create', data);
}

// 岗位更新
export const postUpdate = (data: any) => {
  return httpRequest.post('/post/update', data);
}

// 岗位删除
export const postDelete = (params: any) => {
  return httpRequest.get('/post/delete', params);
}

// 系统会员、岗位、角色、部门量
export const statisticsSysCounts = () => {
  return httpRequest.get('/statistics/sysCounts');
}

// 系统最近一周会员注册量
export const statisticsUserReg = () => {
  return httpRequest.get('/statistics/userReg');
}

// 全部角色
export const queryAllRoles = () => {
  return httpRequest.get('/role/allData');
}

// 角色列表
export const queryRoles = (params: any) => {
  return httpRequest.get('/role/lists', params);
}

// 角色创建
export const roleCreate = (data: any) => {
  return httpRequest.post('/role/create', data);
}

// 角色更新
export const roleUpdate = (data: any) => {
  return httpRequest.post('/role/update', data);
}

// 角色删除
export const roleDelete = (params: any) => {
  return httpRequest.get('/role/delete', params);
}

// 全部部门
export const queryAllDepts = () => {
  return httpRequest.get('/dept/allData');
}

// 部门列表
export const queryDepts = (params: any) => {
  return httpRequest.get('/dept/lists', params);
}

// 部门创建
export const deptCreate = (data: any) => {
  return httpRequest.post('/dept/create', data);
}

// 部门更新
export const deptUpdate = (data: any) => {
  return httpRequest.post('/dept/update', data);
}

// 部门删除
export const deptDelete = (params: any) => {
  return httpRequest.get('/dept/delete', params);
}

// 查询用户信息
export const queryUserInfo = (params: any) => {
  return httpRequest.get('/user/info', params);
}

// 用户列表
export const queryUsers = (params: any) => {
  return httpRequest.get('/user/lists', params);
}

// 用户创建
export const userCreate = (data: any) => {
  return httpRequest.post('/user/create', data);
}

// 用户更新
export const userUpdate = (data: any) => {
  return httpRequest.post('/user/update', data);
}

// 用户删除
export const userDelete = (params: any) => {
  return httpRequest.get('/user/delete', params);
}

// 全部菜单
export const queryAllMenus = () => {
  return httpRequest.get('/menu/allData');
}

// 全部路由
export const queryAllRoutes = () => {
  return httpRequest.get('/menu/allRoutes');
}

// 菜单列表
export const queryMenus = (params: any) => {
  return httpRequest.get('/menu/lists', params);
}

// 菜单创建
export const menuCreate = (data: any) => {
  return httpRequest.post('/menu/create', data);
}

// 菜单更新
export const menuUpdate = (data: any) => {
  return httpRequest.post('/menu/update', data);
}

// 菜单删除
export const menuDelete = (params: any) => {
  return httpRequest.get('/menu/delete', params);
}